﻿namespace Autodesk.Revit.DB;

/// <summary>
/// 事务失败处理器
/// </summary>
public class FailuresPreprocessorHandler : IFailuresPreprocessor
{
    private readonly Func<FailuresAccessor, FailureProcessingResult> func;

    /// <summary>
    /// 实例化
    /// </summary>
    /// <param name="func">处理方法</param>
    public FailuresPreprocessorHandler(Func<FailuresAccessor, FailureProcessingResult> func)
    {
        this.func = func;
    }

    FailureProcessingResult IFailuresPreprocessor.PreprocessFailures(FailuresAccessor failuresAccessor)
    {
        return func(failuresAccessor);
    }
}
